package Week2.J0427;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class 删除公共字符 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char[] arr = scanner.nextLine().toCharArray();
        char[] arrDelete = scanner.nextLine().toCharArray();
        StringBuffer sbr = new StringBuffer();

        Queue<Character> queue = new LinkedList<>();

        for (int i = 0; i < arr.length; i++) {
            queue.add(arr[i]);
        }

        while (!queue.isEmpty()) {
            for (int i = 0; i < arrDelete.length; i++) {
                if (queue.peek() == arrDelete[i]) {
                    queue.poll();
                    continue;
                }
            }
            if (!queue.isEmpty()) {
                sbr.append(queue.poll());
            }
        }

        System.out.println(sbr.toString());
    }
}
